package com.vx.cloud.dataCloud.controller;

import com.vx.cloud.dataCloud.action.DcClient;
import com.vx.cloud.dataCloud.service.ConsumerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 消费者demo入口
 */
@RestController
public class DcController {
    @Autowired
    DcClient dcClient;

    @Autowired
    ConsumerService consumerService;

    /**
     * 直接通过接口上的Feign注解调用注册到Eureka的接口项目
     */
    @GetMapping("/consumer")
    public String dc() {
        return dcClient.consumer();
    }

    /**
     * 测试断路由
     */
    @GetMapping("/consumerHC")
    public String consumerHC() throws Exception {
        return consumerService.consumer();
    }

    /**
     * 测试断路由
     */
    @GetMapping("/consumerHC2")
    public String consumerHC2() throws Exception {
        return consumerService.consumer2();
    }
}